package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Carinfo;
import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.domain.Guaranteebill;
import cn.wolfcode.crm.query.GuaranteebillQueryObject;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface GuaranteebillMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Guaranteebill record);

    Guaranteebill selectByPrimaryKey(Long id);

    List<Guaranteebill> selectAll();

    int updateByPrimaryKey(Guaranteebill record);

    /**
     * 根据单号修改状态值
     * @param number 单号
     * @param state  状态值
     */
    void updateByNumber(String number);

    //保存产品和保单的关系
    void saveProductAndBillNumberRelation(@Param("productId") Long productId, @Param("number") String number);

    List<Guaranteebill> selectByState(GuaranteebillQueryObject qo);

    void audit(@Param("id") Long id, @Param("autidState") int autidState);
    //退回修改
    void checkClient(@Param("id") Long id, @Param("checkState") int checkState, @Param("message")String message);
    //审核通过
    void auidSuccess(@Param("id") Long id, @Param("successState") int autidsuccessState,
                     @Param("auditor") Employee auditor, @Param("auditDate") Date auditDate);

    //查询保单历史记录分页
    int queryForCount(QueryObject qo);
    List<Guaranteebill> queryForList(QueryObject qo);

    void rejuest(@Param("id") Long id, @Param("rejuestState") int rejuestState);

    void saveNumberAndProductInfo(@Param("number") String number, @Param("pid") Long pid);

    void saveCarsize(@Param("id") Long id, @Param("carSizeId")Long carSizeId);
    //查看批改意见
    String queryAdvice(Long id);
    //查看车辆信息
    Carinfo queryCarInfo(Integer id);
}